package com.example.JavaWebApi.core.mybatisplusextention.wrapperCreator.model;

import com.example.JavaWebApi.core.mybatisplusextention.wrapperCreator.ConnectorType;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: java-web-api
 * @description: 聚合条件模型
 * @author: 杨泽
 * @create: 2023-07-05 10:01
 */
@Data
public class AggregateConditionModel {
    ConnectorType outerConnector;
    List<QueryConditionModel> conditionModelList = new ArrayList<>();

    public Boolean canBuild() {
        return !conditionModelList.stream().allMatch(t -> t.getValue() == null);
    }
}